<script type="text/javascript">
function backToAdd(){
	$("#mainform").prop('action', '/it_center/Libs/addLib');
	return $("#mainform").submit();
}

function backToEdit(){
	$("#mainform").prop('action', '/it_center/Libs/edit');
	return $("#mainform").submit();
}

</script>
<section id="content">
<?php if (isset($libId)){
	echo "<center><H1>Chỉnh sửa thư viện</H1></center>";
}else{
	echo "<center><H1>Thêm thư viện</H1></center>";
}?>

<form id="mainform" method="post" action="/it_center/Libs/libRegist">
<?php if (isset($libId)){
	echo '<input type="hidden" name="libId" value="'.$libId.'" />';
}?>
<input type="hidden" name="isBack" value="" />
<?php if (isset($libTempFile)){
	echo '<input type="hidden" name="libTempFile" value="'.$libTempFile.'"/>';
}?>

<?php if (isset($libOldFile)){
	echo '<input type="hidden" name="libOldFile" value="'.$libOldFile.'"/>';
}
?>

<input type="hidden" name="libFileName" value="<?php echo $libFileName;?>" />
<input type="hidden" name="libDesc" value="<?php echo $libDescript;?>" />
<input type="hidden" name="libTitle" value="<?php echo $libTitle;?>" />
<input type="hidden" name="subId" value="<?php echo $subId;?>" />
<input type="hidden" name="subName" value="<?php echo $subName;?>" />
<table id="edit_table">
	<tr>
		<td class="edit_column" width="170">Tiêu đề</td>
		<td>
			<?php echo $libTitle;?>
		</td>
	</tr>
	<tr>	
		<td class="edit_column">File</td>
		<td>
			<?php echo $libFileName;?>
		</td>
	</tr>
	<tr>	
		<td class="edit_column" style="vertical-align: top;">Mô tả</td>
		<td>
			<textarea disabled name="libDescript" style="width: 99%;" rows="10"><?php echo html_entity_decode($libDescript, ENT_QUOTES, 'utf-8');?></textarea>
		</td>
	</tr>
	<tr>
		<td colspan="2" style="text-align: center;">
			<button type="submit">Hoàn Tất</button>
			<button type="button" onclick=<?php echo (isset($libId)) ? "backToEdit()": "backToAdd()"; ?>>Quay Lại</button>
		</td>
	</tr>
</table>
</form>
</section>